/**
 * Created by bai on 2015/7/23.
 */
var Mine = function(){
    var STARTTIMEFLAG = true;
    var ENDTTIMEFLAG = false;
    var PERFORMANCESELECTTIEM = $('#subperformancePage');
    var PERFORMANCETIMESTART = {//查询绩效的开始时间
        year:"",
        month:"",
        date:"",
        hour:"",
        minute:""
    }
    var PERFORMANCETIMEEND = {//查询绩效的结束时间
        year:"",
        month:"",
        date:"",
        hour:"",
        minute:""
    }
    var HISTORY = {};
    var HISTORYTIME = "";
    /*
     * 得到cookie
     * */
    function getCookie(c_name)
    {
        if (document.cookie.length>0)
        {
            c_start=document.cookie.indexOf(c_name + "=")
            if (c_start!=-1)
            {
                c_start=c_start + c_name.length+1
                c_end=document.cookie.indexOf(";",c_start)
                if (c_end==-1) c_end=document.cookie.length
                return unescape(document.cookie.substring(c_start,c_end))
            }
        }
        return ""
    }
    /*
     * 获得月份的天数
     * */
    function DayNumOfMonth(Year,Month)
    {
        var d = new Date(Year,Month,0);
        return d.getDate();
    }
    (function(){
        var i=0;
        //在绩效的选择时间的地方，添加月份
        for(i=1;i<=12;i++ ){
            $('.monthList',PERFORMANCESELECTTIEM).append('<li class="monthInfo" data-function="btn_mine_chooseOneMonth" data-time="'+i+'">'+i+'月</li>')
        }
        //在绩效的选择时间的地方，添加几号
        var time = new Date();
        var  monthMaxDays = DayNumOfMonth(time.getFullYear(),(time.getMonth()+1));
        //alert(monthMaxDays);
        for(i=1;i<=monthMaxDays;i++ ){
            $('.dayList',PERFORMANCESELECTTIEM).append('<li class="dayInfo" data-function="btn_mine_chooseOneDate" data-time="'+i+'">'+i+'日</li>')
        }
        //在绩效的选择时间的地方，添加小时
        for(i=0;i<=23;i++ ){
            $('.hourList',PERFORMANCESELECTTIEM).append('<li class="monthInfo" data-function="btn_mine_chooseOneHour" data-time="'+i+'">'+i+'时</li>')
        }
        //在绩效的选择时间的地方，添加分钟
        for(i=0;i<=59;i++ ){
            $('.minuteList',PERFORMANCESELECTTIEM).append('<li class="monthInfo" data-function="btn_mine_chooseOneMinute" data-time="'+i+'">'+i+'分</li>')
        }
        //alert((time.getMonth()+1))
        $('.performanceMonth',PERFORMANCESELECTTIEM).html((time.getMonth()+1)+"月");
        $('.performanceDate',PERFORMANCESELECTTIEM).html((time.getDate())+"日");
        PERFORMANCETIMESTART.year = time.getFullYear();
        PERFORMANCETIMESTART.month = (time.getMonth()+1);
        PERFORMANCETIMESTART.date = (time.getDate());
        PERFORMANCETIMEEND.year = time.getFullYear();
        PERFORMANCETIMEEND.month = (time.getMonth()+1);
        PERFORMANCETIMEEND.date = (time.getDate());



    }());
    /*
     * 点击主页面上的底部的我的按钮
     * */
    var mineBtn = function(fun){
        var mainPageminePage  = $('#mainPageminePage');
        //var name =  getCookie('bqcuser_name');
        var name =  localStorage.getItem('bqcuser_name');
        //alert(name)
        $('#atl_name').html("服务员："+name);
        OrderingSystem.getRestaurant(function (data) {
            $('#atl_ch').html(data.data[0].RName+'（'+data.data[0].address.suburb+'）');
        });
        fun();
    };
    /*
     * 主页面上的交班按钮
     * */
    var shiftExchange = function(fun){
        var parentsNode = $('#subhandOverWorkPage');
        $('.caseText',parentsNode).val("");
        var timeO = new Date();
        timeO=timeO.getFullYear()+"-"+(timeO.getMonth()+1)+"-"+timeO.getDate();
        var options = {};
        options.start = timeO;
        options.end = timeO;
        options.payType = [];
        options.successFunction = function (data) {
            $('.payResultList',parentsNode).html('');
            var cashPay = "";
            var posPay = "";
            var time = new Date();
            var timePayWay = time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate();
            time=(time.getMonth()+1)+"月"+time.getDate()+"日"
            /*       $.each(data.data[0].normalPay,function(k,v){
             if(v.key=="cash"){
             cashPay=v.amount/100;
             }else if(v.key=="pos"){
             posPay = v.amount/100;
             }
             })*/
            /* if(data.data[0]){
             cashPay=data.data[0].cash?data.data[0].cash/100:"0";
             posPay=data.data[0].pos?data.data[0].pos/100:"0";
             }else{
             cashPay=0;
             posPay=0;
             }*/
            $.each(data.data[0].normalPay,function(k,v){
                if(v.key=="cash"){
                    cashPay=v.amount/100;
                }else if(v.key=="pos"){
                    posPay=v.amount/100;
                }


            })


            $('  <li class="time">交班信息</li>\
                <li class="payInfo" data-function="btn_minePayWayCashShiftExchange" data-date="'+timePayWay+'" data-money="'+cashPay+'">\
                <p class="payType" data-function="btn_minePayWayCashShiftExchange" data-date="'+timePayWay+'" data-money="'+cashPay+'">现金：</p>\
                <p class="money cashMoney" data-function="btn_minePayWayCashShiftExchange" data-date="'+timePayWay+'" data-money="'+cashPay+'">￥'+cashPay+'</p>\
            <div class="goIco" data-function="btn_minePayWayCashShiftExchange" data-date="'+timePayWay+'" data-money="'+cashPay+'"></div>\
            </li>\
            <li class="payInfo" data-function="btn_minePayWayPosShiftExchange" data-date="'+timePayWay+'" data-money="'+posPay+'">\
                <p class="payType" data-function="btn_minePayWayPosShiftExchange" data-date="'+timePayWay+'" data-money="'+posPay+'">划卡：</p>\
                <p class="money posMoney" data-function="btn_minePayWayPosShiftExchange" data-date="'+timePayWay+'" data-money="'+posPay+'">￥'+posPay+'</p>\
                <div class="goIco" data-function="btn_minePayWayPosShiftExchange" data-date="'+timePayWay+'" data-money="'+posPay+'"></div>\
            </li>\
            <li class="payInfo" data-function="btn_minePayWayNetShiftExchange" data-date="'+timePayWay+'" data-money="">\
                <p class="payType" data-function="btn_minePayWayNetShiftExchange" data-date="'+timePayWay+'" data-money="">网络支付：</p>\
                <p class="money netMoney" data-function="btn_minePayWayNetShiftExchange" data-date="'+timePayWay+'" data-money="">￥0</p>\
                <div class="goIco" data-function="btn_minePayWayNetShiftExchange" data-date="'+timePayWay+'" data-money=""></div>\
                </li>').appendTo('#subhandOverWorkPage .payResultList');


        };
        OrderingSystem.showShiftTurnoverInfo(options);
        fun();
    };
    /*
     * 接口：得到某种支付方式的明细
     * */
    var neiGetOrderInfo = function(type,data,node){
        $.each(data,function(indexPayList,itemPayList){
            var out='';
            var time=null;
            var oId = itemPayList.OrderId;
            OrderingSystem.getOrderById(oId, function (data) {
                var dataPort = data.data[0];
                time=new Date(data.data[0].time.sec*1000);
                time=time.getHours()+':'+time.getMinutes();
                //alert(type)
                OrderingSystem.getOrderPayTransByOrderId(oId, function (dataOrderPay) {
                    $.each(dataOrderPay.data,function(indexOrderPay,itemOrderPay){
                        if(itemOrderPay.type==type){
                            if(itemOrderPay.amount>0){
                                if(dataPort.targetValue!=0){
                                    $('<li class="infoList" data-function="btn_orderingFood_billOrder_billed" data-id="'+dataPort.id+'">\
                                    <p class="time" data-function="btn_orderingFood_billOrder_billed" data-id="'+dataPort.id+'">'+time+'</p>\
                                <p class="way" data-function="btn_orderingFood_billOrder_billed" data-id="'+dataPort.id+'">堂食</p>\
                                <p class="info" data-function="btn_orderingFood_billOrder_billed" data-id="'+dataPort.id+'">'+dataPort.targetLabel+'</p>\
                                    <p class="money" data-function="btn_orderingFood_billOrder_billed" data-id="'+dataPort.id+'">￥'+itemOrderPay.amount/100+'</p>\
                                    </li>').appendTo(node);
                                }else{
                                    $('<li class="infoList" data-function="btnacceptTakeOut" data-id="'+dataPort.id+'">\
                                    <p class="time" data-function="btnacceptTakeOut" data-id="'+dataPort.id+'">'+time+'</p>\
                                <p class="way" data-function="btnacceptTakeOut" data-id="'+dataPort.id+'">外卖</p>\
                                <p class="info" data-function="btnacceptTakeOut" data-id="'+dataPort.id+'">'+dataPort.targetLabel+'</p>\
                                <p class="money" data-function="btnacceptTakeOut" data-id="'+dataPort.id+'">￥'+itemOrderPay.amount/100+'</p>\
                                </li>').appendTo(node);
                                }
                            }

                        }

                    })
                    $('.tableModalDtail').append(out);
                });


            });
        })
    }
    /*
     * 交班的现金支付
     * */
    var shiftExchangePayWayOfCash = function(obj,fun){
        var options = {};
        options.successFunction = function (data) {
            var timeArray = obj.data('date').split('-');
            var timeNode = timeArray[1]+"月"+timeArray[2]+"日"
            $('#subcashPayRecordPage .cont').html('');
            $('<li class="timeInfo" >'+timeNode+'</li><li class="payInfo">\
                <p class="payType" > 现金支付：</p>\
                <p class="money">￥'+obj.data('money')+'</p>\
            </li>').appendTo('#subcashPayRecordPage .cont')
            fun();
            neiGetOrderInfo('cash',data.data[0].payTrans,'#subcashPayRecordPage .cont');
        };
        OrderingSystem.showShiftTurnoverInfo(options);
    }
    /*
     * 交班的pos支付
     * */
    var shiftExchangePayWayOfPos = function(obj,fun){
        var options = {};
        options.successFunction = function (data) {
            var timeArray = obj.data('date').split('-');
            var timeNode = timeArray[1]+"月"+timeArray[2]+"日"
            $('#subcardPayRecordPage .cont').html('');
            $('<li class="timeInfo" >'+timeNode+'</li><li class="payInfo">\
                <p class="payType" > 划卡支付：</p>\
                <p class="money">￥'+obj.data('money')+'</p>\
            </li>').appendTo('#subcardPayRecordPage .cont')
            fun();
            neiGetOrderInfo('pos',data.data[0].payTrans,'#subcardPayRecordPage .cont');
        };
        OrderingSystem.showShiftTurnoverInfo(options);
    }
    /*
     * 交班的网络支付
     * */
    var shiftExchangePayWayOfNet = function(obj,fun){
        fun();
    }
    /*
     * 主页面上绩效按钮
     * */
    var performance = function(fun){
        var time = new Date();
        var timeOp = time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate();
        var options = {};
        options.start = timeOp;
        options.end = timeOp;
        options.successFunction = function (data) {
            var timeString = (time.getMonth()+1)+"月"+time.getDate()+"日"
            var dataPort = data.data[0];
            $('#subperformancePage .cont').html("");
            fun();
            $('        <li class="time">'+timeString+'8：30-'+timeString+'18:45</li>\
                    <li class="performanceInfo" data-function="btn_mine_dealWithServe" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeServices+'">\
                <p class="performanceType" data-function="btn_mine_dealWithServe" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeServices+'">处理服务</p>\
                <p class="count" data-function="btn_mine_dealWithServe" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeServices+'">'+dataPort.disposeServices+'次</p>\
            <div class="goIco" data-function="btn_mine_dealWithServe" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeServices+'"></div>\
            </li>\
            <li class="performanceInfo" data-function="btn_mine_dealWithReserve" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeReserve+'">\
                <p class="performanceType" data-function="btn_mine_dealWithReserve" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeReserve+'">处理预定</p>\
                <p class="count" data-function="btn_mine_dealWithReserve" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeReserve+'">'+dataPort.disposeReserve+'次</p>\
                <div class="goIco" data-function="btn_mine_dealWithReserve" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeReserve+'"></div>\
            </li>\
            <li class="performanceInfo" data-function="btn_mine_dealTakeOut" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeTakeout+'">\
                <p class="performanceType" data-function="btn_mine_dealTakeOut" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeTakeout+'">处理外卖</p>\
                <p class="count" data-function="btn_mine_dealTakeOut" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeTakeout+'">'+dataPort.disposeTakeout+'次</p>\
            <div class="goIco" data-function="btn_mine_dealTakeOut" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.disposeTakeout+'"></div>\
            </li>\
            <li class="performanceInfo" data-function="btn_mine_dealBilled" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.checkOrder+'">\
                <p class="performanceType" data-function="btn_mine_dealBilled" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.checkOrder+'">结算订单</p>\
                <p class="count" data-function="btn_mine_dealBilled" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.checkOrder+'">'+dataPort.checkOrder+'次</p>\
                <div class="goIco" data-function="btn_mine_dealBilled" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.checkOrder+'"></div>\
            </li>\
            <li class="performanceInfo" data-function="btn_mine_promoteTheTask" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.promotionTask+'">\
                <p class="performanceType" data-function="btn_mine_promoteTheTask" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.promotionTask+'">推广任务</p>\
                <p class="count" data-function="btn_mine_promoteTheTask" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.promotionTask+'">'+dataPort.promotionTask+'次</p>\
            <div class="goIco" data-function="btn_mine_promoteTheTask" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.promotionTask+'"></div>\
            </li>\
            <li class="performanceInfo" data-function="btn_mine_goodProbability" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.feedbackRate+'">\
                <p class="performanceType" data-function="btn_mine_goodProbability" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.feedbackRate+'">好评率</p>\
                <p class="count" data-function="btn_mine_goodProbability" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.feedbackRate+'">'+dataPort.feedbackRate+'</p>\
                <div class="goIco" data-function="btn_mine_goodProbability" data-start="'+timeOp+'" data-end="'+timeOp+'" data-number="'+dataPort.feedbackRate+'"></div>\
            </li>').appendTo('#subperformancePage .cont');
        };
        OrderingSystem.getNEXByDateTime(options);

    }
    /*
     * 主页面上的网络按钮
     * */
    var netWork = function(fun){
        //fun();
    }
    /*
     *交班的确定按钮
     * */
    var shiftExchangeOk = function(){
        var parents = $('#subhandOverWorkPage');
        $('.IndexPage',parents).show();
        $('.handOverWorkOrNo',parents).show();
    }
    /*
     * 弹出框不交班
     * */
    var shiftExchangePromptNot = function(){
        var parents = $('#subhandOverWorkPage');
        $('.IndexPage',parents).hide();
        $('.handOverWorkOrNo',parents).hide();
    }
    /*
     * 弹出框交班
     * */
    var shiftExchangePromptYes = function(fun){
        var parents = $('#subhandOverWorkPage');
        $('.IndexPage',parents).hide();
        $('.handOverWorkOrNo',parents).hide();
        var options = {};
        options.remark = $('.caseText',parents).val();
        options.successFunction = function (data) {

        };
        OrderingSystem.shiftTurnover(options);
        fun();
    }
    /*
     * 查询交班
     * */
    var inquireShiftExchange = function(fun){
        $('#subpayRecordPage .cont').html('');
        var time = new Date();
        var options = {};
        options.end = time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate();
        time.setMonth(time.getMonth() - 1);
        options.start =time.getFullYear()+"-"+(time.getMonth()+1)+"-"+"1";
        options.payType = [];
        options.successFunction = function (data) {
            fun();
            $.each(data.data,function(k,v){
                var arr = v.day.split('-');
                var str = arr.join('/');
                $('<li class="recordInfo" data-function="btn_mineShiftExchageHistory" data-time="'+ new Date(str) +'">\
                       <p class="time" data-function="btn_mineShiftExchageHistory" data-time="'+ new Date(str) +'">'+ arr[1] +"月" + arr[2] + "日"+'</p>\
                       <p class="go" data-function="btn_mineShiftExchageHistory" data-time="'+ new Date(str) +'"></p>\
                   </li>').appendTo('#subpayRecordPage .cont')
            });
        };
        OrderingSystem.getUserIdPayAmountByDate(options);


        //老的显示交班信息的程序
        /*var time = new Date();
         var options = {};
         options.start =time.getFullYear()+"-"+(time.getMonth()+1)+"-"+"1";
         options.end = time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate();
         options.payType = [];
         options.successFunction = function (data) {
         $('#subpayRecordPage .cont').html("");
         fun();
         $.each(data.data,function(k,v){
         var timeArray = v.day.split('-');
         var timeString= timeArray[1]+"月"+timeArray[2]+"日"
         $('<li class="recordInfo" data-function="btn_mineShiftExchageHistoryOne" data-time="'+v.day+'">\
         <p class="time" data-function="btn_mineShiftExchageHistoryOne" data-time="'+v.day+'">'+timeString+'8:30-'+timeString+'18:45</p>\
         <p class="go" data-function="btn_mineShiftExchageHistoryOne" data-time="'+v.day+'"></p>\
         </li>').appendTo('#subpayRecordPage .cont')
         })
         };
         OrderingSystem.getUserIdPayAmountByDate(options);*/

    }
    /*
     * 查询绩效
     * */
    var inquirePerformance = function(){
        var parents = $('#subperformancePage');
        $('.IndexPage',parents).show();
        $('.chooseTimePage',parents).show();

    }
    /*
     * 查询绩效，选择时间的确定按钮
     * */
    var inquirePerformanceSelectTimeOk = function(fun){
        var parents = $('#subperformancePage');
        $('.IndexPage',parents).hide();
        $('.chooseTimePage',parents).hide();
        $('.monthList',PERFORMANCESELECTTIEM).hide();
        $('.dayList',PERFORMANCESELECTTIEM).hide();
        $('.hourList',PERFORMANCESELECTTIEM).hide();
        $('.minuteList',PERFORMANCESELECTTIEM).hide();
        var time = new Date();

        var options = {};
        options.start = time.getFullYear()+"-"+PERFORMANCETIMESTART.month+"-"+PERFORMANCETIMESTART.date;
        options.end = time.getFullYear()+"-"+PERFORMANCETIMEEND.month+"-"+PERFORMANCETIMEEND.date;
        options.successFunction = function (data) {
            if(data.error>0){

            }else{
                var timeStringStart = (PERFORMANCETIMESTART.month)+"月"+PERFORMANCETIMESTART.date+"日"
                var timeStringEnd = (PERFORMANCETIMEEND.month)+"月"+PERFORMANCETIMEEND.date+"日"
                var dataPort = data.data[0];
                $('#subperformancePage .cont').html("");
                //fun();
                $('        <li class="time">'+timeStringStart+'8：30-'+timeStringEnd+'18:45</li>\
                    <li class="performanceInfo" data-function="btn_mine_dealWithServe" data-start="'+ options.start+'" data-end="'+options.end+'" data-number="'+dataPort.disposeServices+'">\
                <p class="performanceType" data-function="btn_mine_dealWithServe" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeServices+'">处理服务</p>\
                <p class="count" data-function="btn_mine_dealWithServe" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeServices+'">'+dataPort.disposeServices+'次</p>\
            <div class="goIco" data-function="btn_mine_dealWithServe" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeServices+'"></div>\
            </li>\
            <li class="performanceInfo" data-function="btn_mine_dealWithReserve" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeReserve+'">\
                <p class="performanceType" data-function="btn_mine_dealWithReserve" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeReserve+'">处理预定</p>\
                <p class="count" data-function="btn_mine_dealWithReserve" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeReserve+'">'+dataPort.disposeReserve+'次</p>\
                <div class="goIco" data-function="btn_mine_dealWithReserve" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeReserve+'"></div>\
            </li>\
            <li class="performanceInfo" data-function="btn_mine_dealTakeOut" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeTakeout+'">\
                <p class="performanceType" data-function="btn_mine_dealTakeOut" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeTakeout+'">处理外卖</p>\
                <p class="count" data-function="btn_mine_dealTakeOut" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeTakeout+'">'+dataPort.disposeTakeout+'次</p>\
            <div class="goIco" data-function="btn_mine_dealTakeOut" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.disposeTakeout+'"></div>\
            </li>\
            <li class="performanceInfo" data-function="btn_mine_dealBilled" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.checkOrder+'">\
                <p class="performanceType" data-function="btn_mine_dealBilled" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.checkOrder+'">结算订单</p>\
                <p class="count" data-function="btn_mine_dealBilled" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.checkOrder+'">'+dataPort.checkOrder+'次</p>\
                <div class="goIco" data-function="btn_mine_dealBilled" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.checkOrder+'"></div>\
            </li>\
            <li class="performanceInfo" data-function="btn_mine_promoteTheTask" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.promotionTask+'">\
                <p class="performanceType" data-function="btn_mine_promoteTheTask" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.promotionTask+'">推广任务</p>\
                <p class="count" data-function="btn_mine_promoteTheTask" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.promotionTask+'">'+dataPort.promotionTask+'次</p>\
            <div class="goIco" data-function="btn_mine_promoteTheTask" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.promotionTask+'"></div>\
            </li>\
            <li class="performanceInfo" data-function="btn_mine_goodProbability" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.feedbackRate+'">\
                <p class="performanceType" data-function="btn_mine_goodProbability" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.feedbackRate+'">好评率</p>\
                <p class="count" data-function="btn_mine_goodProbability" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.feedbackRate+'">'+dataPort.feedbackRate+'</p>\
                <div class="goIco" data-function="btn_mine_goodProbability" data-start="'+ options.start+'" data-end="'+options.end+'"  data-number="'+dataPort.feedbackRate+'"></div>\
            </li>').appendTo('#subperformancePage .cont');
            }

        };
        OrderingSystem.getNEXByDateTime(options);
    }
    /*
     * 查询一天的历史记录
     * */
    var seeOneHistoryOneDay = function(obj,fun){
        var date = new Date(obj.data('time'));
        var toDay = (date.getMonth() + 1) +"月"+date.getDate()+"日";
        var options = {};
        //options.userId = getCookie('bqcuser_id');
        options.userId = localStorage.getItem('bqcuser_id');
        options.start = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
        date.setDate(date.getDate() + 1);
        options.end = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
        options.successFunction = function (data) {
            HISTORY = data.data;
            $('#subpayOneDayPage .cont').html('');
            $('<li class="recordInfo">\
                   <p class="toDayTime">'+toDay+'</p>\
               </li>').appendTo('#subpayOneDayPage .cont')
            $.each(HISTORY,function(k,v){
                var time = new Date(v.time.sec * 1000);
                var a = time.getHours() + ":" + time.getMinutes();
                $('<li class="recordInfo" data-function="btn_mineShiftExchageHistoryOne" data-time="'+v.time.sec+'">\
                   <p class="time" data-function="btn_mineShiftExchageHistoryOne" data-time="'+v.time.sec+'">交班时间： '+ a +'</p>\
                   <p class="go" data-function="btn_mineShiftExchageHistoryOne" data-time="'+v.time.sec+'"></p>\
               </li>').appendTo('#subpayOneDayPage .cont')
            });
            fun();
        };
        OrderingSystem.shiftTurnoverHistoryByDateRange(options);
    };
    /*
     * 查询一条历史记录
     * */
    var seeOneHistoryRecord = function(obj,fun){
        HISTORYTIME = obj.data('time');
        $.each(HISTORY,function(k,v){
            if(v.time.sec == HISTORYTIME){
                var time = new Date(v.time.sec * 1000);
                var cashPay = "";
                var posPay = "";
                $.each(v.normalPay,function(kone,vone){
                    if(vone.key=="cash"){
                        cashPay=vone.amount/100;
                    }else if(vone.key=="pos"){
                        posPay = vone.amount/100;
                    }
                });
                $('#subhandOverWorkRecordPage .payResultList').html("");
                $('<li class="time">交班时间'+time.getHours()+':'+time.getMinutes()+'</li>\
                       <li class="payInfo" data-function="btn_minePayWayCash" data-money="'+cashPay+'">\
                       <p class="payType" data-function="btn_minePayWayCash" data-money="'+cashPay+'">现金：</p>\
                       <p class="money cashMoney" data-function="btn_minePayWayCash" data-money="'+cashPay+'">￥'+cashPay+'</p>\
                       <div class="goIco" data-function="btn_minePayWayCash" data-money="'+cashPay+'"></div>\
                   </li>\
                   <li class="payInfo" data-function="btn_minePayWayPos" data-money="'+posPay+'">\
                       <p class="payType" data-function="btn_minePayWayPos" data-money="'+posPay+'">划卡：</p>\
                       <p class="money posMoney" data-function="btn_minePayWayPos" data-money="'+posPay+'">￥'+posPay+'</p>\
                       <div class="goIco" data-function="btn_minePayWayPos" data-money="'+posPay+'"></div>\
                   </li>\
                   <li class="payInfo" data-function="btn_minePayWayNet" data-money="">\
                       <p class="payType" data-function="btn_minePayWayNet" data-money="">网络支付：</p>\
                       <p class="money netMoney" data-function="btn_minePayWayNet" data-money="">￥0</p>\
                       <div class="goIco" data-function="btn_minePayWayNet" data-money=""></div>\
                   </li>').appendTo('#subhandOverWorkRecordPage .payResultList');
            }
        });
        fun();
    }
    /*
     * 查询一条历史记录(老)
     * */
    /*var seeOneHistoryRecord = function(obj,fun){
     var time = new Date();

     var options = {};
     options.start = obj.data('time');
     options.end = obj.data('time');
     options.payType = [];
     options.successFunction = function (data) {

     $('#subhandOverWorkRecordPage .payResultList').html("");
     fun();
     var cashPay = "";
     var posPay = "";
     //var time = new Date();
     //var timePayWay = time.getFullYear()+"-"+(time.getMonth()+1)+"-"+time.getDate();
     var timePayWay = obj.data('time');
     var timeArray = obj.data('time').split('-');
     //time=(time.getMonth()+1)+"月"+time.getDate()+"日"
     var time=timeArray[1]+"月"+timeArray[2]+"日";
     /!*       $.each(data.data[0].normalPay,function(k,v){
     if(v.key=="cash"){
     cashPay=v.amount/100;
     }else if(v.key=="pos"){
     posPay = v.amount/100;
     }
     })*!/
     cashPay=data.data[0].cash?data.data[0].cash/100:"0";
     posPay=data.data[0].pos?data.data[0].pos/100:"0";
     $('  <li class="time">'+time+'8：30-'+time+'18:45</li>\
     <li class="payInfo" data-function="btn_minePayWayCash" data-date="'+timePayWay+'" data-money="'+cashPay+'">\
     <p class="payType" data-function="btn_minePayWayCash" data-date="'+timePayWay+'" data-money="'+cashPay+'">现金：</p>\
     <p class="money cashMoney" data-function="btn_minePayWayCash" data-date="'+timePayWay+'" data-money="'+cashPay+'">￥'+cashPay+'</p>\
     <div class="goIco" data-function="btn_minePayWayCash" data-date="'+timePayWay+'" data-money="'+cashPay+'"></div>\
     </li>\
     <li class="payInfo" data-function="btn_minePayWayPos" data-date="'+timePayWay+'" data-money="'+posPay+'">\
     <p class="payType" data-function="btn_minePayWayPos" data-date="'+timePayWay+'" data-money="'+posPay+'">划卡：</p>\
     <p class="money posMoney" data-function="btn_minePayWayPos" data-date="'+timePayWay+'" data-money="'+posPay+'">￥'+posPay+'</p>\
     <div class="goIco" data-function="btn_minePayWayPos" data-date="'+timePayWay+'" data-money="'+posPay+'"></div>\
     </li>\
     <li class="payInfo" data-function="btn_minePayWayNet" data-date="'+timePayWay+'" data-money="">\
     <p class="payType" data-function="btn_minePayWayNet" data-date="'+timePayWay+'" data-money="">网络支付：</p>\
     <p class="money netMoney" data-function="btn_minePayWayNet" data-date="'+timePayWay+'" data-money="">￥0</p>\
     <div class="goIco" data-function="btn_minePayWayNet" data-date="'+timePayWay+'" data-money=""></div>\
     </li>').appendTo('#subhandOverWorkRecordPage .payResultList');
     };
     OrderingSystem.getUserIdPayAmountByDate(options);
     fun();
     }*/
    /*
     * 现金支付
     * */
    var cashPay = function(obj,fun){
        var time = new Date(HISTORYTIME *1000);
        $('#subcashPayRecordPage .cont').html("");
        $('<li class="timeInfo" >交班时间'+time.getHours()+':'+time.getMinutes()+'</li><li class="payInfo">\
               <p class="payType" > 现金支付：</p>\
               <p class="money">￥'+obj.data('money')+'</p>\
           </li>').appendTo('#subcashPayRecordPage .cont');
        fun();
        $.each(HISTORY,function(khistory,vhistory){
            if(vhistory.time.sec == HISTORYTIME){
                $.each(vhistory.orderIdList,function(k,v){
                    var oId =v;
                    OrderingSystem.getOrderById(oId, function (dataorder) {
                        OrderingSystem.getOrderPayTransByOrderId(oId, function (data) {
                            $.each(data.data,function(kP,vP){
                                var orderTime = new Date(vP.time.sec * 1000);
                                if(vP.type=="cash"){
                                    if(vP.amount>0){
                                        if(vP.targetValue!=0){
                                            $('<li class="infoList" data-function="btn_orderingFood_billOrder_billed" data-id="'+oId+'">\
                                               <p class="time" data-function="btn_orderingFood_billOrder_billed" data-id="'+oId+'">'+orderTime.getHours()+':'+orderTime.getMinutes()+'</p>\
                                               <p class="way" data-function="btn_orderingFood_billOrder_billed" data-id="'+oId+'">堂食</p>\
                                               <p class="info" data-function="btn_orderingFood_billOrder_billed" data-id="'+oId+'">'+dataorder.data[0].targetLabel+'</p>\
                                               <p class="money" data-function="btn_orderingFood_billOrder_billed" data-id="'+oId+'">￥'+vP.amount/100+'</p>\
                                           </li>').appendTo('#subcashPayRecordPage .cont');
                                        }else{
                                            $('<li class="infoList" data-function="btnacceptTakeOut" data-id="'+oId+'">\
                                               <p class="time" data-function="btnacceptTakeOut" data-id="'+oId+'">'+orderTime.getHours()+':'+orderTime.getMinutes()+'</p>\
                                               <p class="way" data-function="btnacceptTakeOut" data-id="'+oId+'">外卖</p>\
                                               <p class="info" data-function="btnacceptTakeOut" data-id="'+oId+'">'+dataorder.data[0].targetLabel+'</p>\
                                               <p class="money" data-function="btnacceptTakeOut" data-id="'+oId+'">￥'+vP.amount/100+'</p>\
                                           </li>').appendTo('#subcashPayRecordPage .cont');
                                        }
                                    }
                                }
                            })
                        });
                    });
                })
            }
        });
    }
    /*
     * Pos支付
     * */
    var posPay = function(obj,fun){
        var time = new Date(HISTORYTIME *1000);
        $('#subcardPayRecordPage .cont').html("");
        $('<li class="timeInfo" >交班时间'+time.getHours()+':'+time.getMinutes()+'</li><li class="payInfo">\
               <p class="payType" > 划卡支付：</p>\
               <p class="money">￥'+obj.data('money')+'</p>\
           </li>').appendTo('#subcardPayRecordPage .cont');
        fun();
        $.each(HISTORY,function(khistory,vhistory){
            if(vhistory.time.sec == HISTORYTIME){
                $.each(vhistory.orderIdList,function(k,v){
                    var oId =v;
                    OrderingSystem.getOrderById(oId, function (dataorder) {
                        OrderingSystem.getOrderPayTransByOrderId(oId, function (data) {
                            $.each(data.data,function(kP,vP){
                                var orderTime = new Date(vP.time.sec * 1000);
                                if(vP.type=="pos"){
                                    if(vP.amount>0){
                                        if(vP.targetValue!=0){
                                            $('<li class="infoList" data-function="btn_orderingFood_billOrder_billed" data-id="'+oId+'">\
                                               <p class="time" data-function="btn_orderingFood_billOrder_billed" data-id="'+oId+'">'+orderTime.getHours()+':'+orderTime.getMinutes()+'</p>\
                                               <p class="way" data-function="btn_orderingFood_billOrder_billed" data-id="'+oId+'">堂食</p>\
                                               <p class="info" data-function="btn_orderingFood_billOrder_billed" data-id="'+oId+'">'+dataorder.data[0].targetLabel+'</p>\
                                               <p class="money" data-function="btn_orderingFood_billOrder_billed" data-id="'+oId+'">￥'+vP.amount/100+'</p>\
                                           </li>').appendTo('#subcardPayRecordPage .cont');
                                        }else{
                                            $('<li class="infoList" data-function="btnacceptTakeOut" data-id="'+oId+'">\
                                               <p class="time" data-function="btnacceptTakeOut" data-id="'+oId+'">'+orderTime.getHours()+':'+orderTime.getMinutes()+'</p>\
                                               <p class="way" data-function="btnacceptTakeOut" data-id="'+oId+'">外卖</p>\
                                               <p class="info" data-function="btnacceptTakeOut" data-id="'+oId+'">'+dataorder.data[0].targetLabel+'</p>\
                                               <p class="money" data-function="btnacceptTakeOut" data-id="'+oId+'">￥'+vP.amount/100+'</p>\
                                           </li>').appendTo('#subcardPayRecordPage .cont');
                                        }
                                    }
                                }
                            })
                        });
                    });
                })
            }
        });
    }
    /*
     * 网络支付
     * */
    var netWorkPay = function(obj,fun){
        fun()
    }
    /*
     * 绩效，处理服务
     * */
    var dealWithSevice = function(obj,fun){
        var options = {};
        options.startDay = obj.data('start');
        options.endDay = obj.data('end');
        options.StatusType = ["complete"];
        options.successFunction = function (data) {
            var timeArrayStart = obj.data('start').split('-');
            var timeArrayEnd = obj.data('end').split('-');
            var timeNodeStart = timeArrayStart[1]+"月"+timeArrayStart[2]+"日"
            var timeNodeEnd = timeArrayEnd[1]+"月"+timeArrayEnd[2]+"日"
            $("#subperformanceServePage .cont").html("");
            fun();
            $('  <li class="timeInfo">'+timeNodeStart+'8：30-'+timeNodeEnd+'21:45</li>\
                   <li class="dealCount">绩效服务'+obj.data('number')+'次</li>').appendTo("#subperformanceServePage .cont")

            $.each(data.data,function(k,v){
                var timeOk = new Date(v.respondedTime.sec*1000);
                timeOk=timeOk.getHours()+":"+timeOk.getMinutes();
                var tId = v.TId;
                OrderingSystem.getTableById(tId, function (data) {
                    $('<li class="dealInfo" data-function="btn_taskAcceptServiceList" data-id="'+v.id+'">\
                       <p class="deal" data-function="btn_taskAcceptServiceList" data-id="'+v.id+'">'+data.data[0].label+'：要'+v.detail+'</p>\
                <p class="time" data-function="btn_taskAcceptServiceList" data-id="'+v.id+'">'+timeOk+'</p>\
                </li>').appendTo('#subperformanceServePage .cont');
                });

            })

        };
        OrderingSystem.getUserCheckServiceByStatusOrDay(options);

    }
    /*
     * 绩效，处理预定
     * */
    var dealWithReserve = function(obj,fun){
        var options = {};
        options.start  = obj.data('start');
        options.end  = obj.data('end');
        options.orderType = ["reserve"];
        options.Status = ["new","confirmed","finished","billed"];
        options.successFunction = function (data) {
            $('#subperformanceOrderPage .cont').html("");
            fun();
            var timeArrayStart = obj.data('start').split('-');
            var timeArrayEnd = obj.data('end').split('-');
            var timeNodeStart = timeArrayStart[1]+"月"+timeArrayStart[2]+"日"
            var timeNodeEnd = timeArrayEnd[1]+"月"+timeArrayEnd[2]+"日"
            $('  <li class="timeInfo">'+timeNodeStart+'8：30-'+timeNodeEnd+'21:45</li>\
                   <li class="dealCount">绩效预定'+obj.data('number')+'次</li>').appendTo("#subperformanceOrderPage .cont")
            $.each(data.data,function(k,v){
                $('<li class="dealInfo" data-function="acceptWeinXinReserve" data-id="'+v.id+'">\
                   <p class="deal" data-function="acceptWeinXinReserve" data-id="'+v.id+'">预定：'+v.reserve.tableClassName+'</p>\
               <p class="time" data-function="acceptWeinXinReserve" data-id="'+v.id+'">'+v.reserve.ResTime+'</p>\
               </li>').appendTo('#subperformanceOrderPage .cont');
            })
        };
        OrderingSystem.getDayOrdertListByStatus(options);

    }
    /*
     * 绩效，处理外卖
     * */
    var dealWithTakeOut = function(obj,fun){
        var options = {};
        options.start  = obj.data('start');
        options.end  = obj.data('end');
        options.orderType = ["takeout"]
        options.Status = ["new","confirmed","finished","billed"];
        options.successFunction = function (data) {
            $('#subperformanceTakeoutPage .cont').html("");
            fun();
            var timeArrayStart = obj.data('start').split('-');
            var timeArrayEnd = obj.data('end').split('-');
            var timeNodeStart = timeArrayStart[1]+"月"+timeArrayStart[2]+"日"
            var timeNodeEnd = timeArrayEnd[1]+"月"+timeArrayEnd[2]+"日"
            $('  <li class="timeInfo">'+timeNodeStart+'8：30-'+timeNodeEnd+'21:45</li>\
                   <li class="dealCount">绩效外卖'+obj.data('number')+'次</li>').appendTo("#subperformanceTakeoutPage .cont")
            $.each(data.data,function(k,v){
                var takeTime = new Date(v.time.sec*1000);
                takeTime = takeTime.getHours()+":"+takeTime.getMinutes();
                $('<li class="dealInfo" data-function="btnacceptTakeOut" data-id="'+v.id+'">\
                    <p class="deal" data-function="btnacceptTakeOut" data-id="'+v.id+'">外卖</p>\
                    <p class="address" data-function="btnacceptTakeOut" data-id="'+v.id+'">'+v.targetLabel+'</p>\
                    <p class="time" data-function="btnacceptTakeOut" data-id="'+v.id+'">'+takeTime+'</p>\
                </li>').appendTo('#subperformanceTakeoutPage .cont');
            })
        };
        OrderingSystem.getDayOrdertListByStatus(options);

    }
    /*
     * 绩效，处理结账订单
     * */
    var dealWithBillOrder = function(obj,fun){
        var options = {};
        options.start  = obj.data('start');
        options.end  = obj.data('end');
        options.orderType = [];
        options.Status = ["billed"];
        options.successFunction = function (data) {
            $('#subperformanceBillCheckPage .cont').html("");
            fun();
            var timeArrayStart = obj.data('start').split('-');
            var timeArrayEnd = obj.data('end').split('-');
            var timeNodeStart = timeArrayStart[1]+"月"+timeArrayStart[2]+"日"
            var timeNodeEnd = timeArrayEnd[1]+"月"+timeArrayEnd[2]+"日"
            $('  <li class="timeInfo">'+timeNodeStart+'8：30-'+timeNodeEnd+'21:45</li>\
                   <li class="dealCount">绩效结算'+obj.data('number')+'次</li>').appendTo("#subperformanceBillCheckPage .cont")
            $.each(data.data,function(k,v){
                var overTime = new Date(v.overTime.sec*1000);
                overTime = overTime.getHours()+":"+overTime.getMinutes();
                if(v.targetValue&&v.targetValue!=0){
                    $('<li class="dealInfo" data-function="btn_orderingFood_billOrder_billed" data-id="'+v.id+'">\
                    <p class="deal" data-function="btn_orderingFood_billOrder_billed" data-id="'+v.id+'">'+v.targetLabel+'</p>\
                    <p class="time" data-function="btn_orderingFood_billOrder_billed" data-id="'+v.id+'">'+overTime+'</p>\
                    </li>').appendTo('#subperformanceBillCheckPage .cont');
                }

            })
        };
        OrderingSystem.getDayOrdertListByStatus(options);

    }
    /*
     * 绩效，处理推广任务
     * */
    var dealWithPromoteTheTask = function(obj,fun){
        var parentsNode = $('#subperformanceSpreadPage');
        var time=obj.data('start').split("-");
        var timeend=obj.data('end').split("-");
        $(parentsNode).html('<ul class="cont">\
           <li class="timeInfo">'+time[1]+'月'+time[2]+'日8：30-'+timeend[1]+'月'+timeend[2]+'日21:45</li>\
        <li class="dealCount">绩效推广999次</li>\
        </ul>')
        fun();
    }
    /*
     * 绩效，好评率
     * */
    var dealWithGoodProbability = function(obj,fun){
        var parentsNode = $('#subperformanceAssessPage');
        var time=obj.data('start').split("-");
        var timeend=obj.data('end').split("-");
        $(parentsNode).html('<ul class="cont">\
           <li class="timeInfo">'+time[1]+'月'+time[2]+'日8：30-'+timeend[1]+'月'+timeend[2]+'日21:45</li>\
        <li class="goodPercent">好评率100%</li>\
        </ul>')
        fun();
    }
    /*
     * 绩效，点击开始时间
     * */
    var performanceClickStartTime = function(){
        var parentsNode = $('#subperformancePage')
        $('.beginTime',parentsNode).addClass("active");
        $('.endTime',parentsNode).removeClass("active");
        STARTTIMEFLAG=true;
        ENDTTIMEFLAG=false ;
    }
    /*
     * 绩效，点击结束时间
     * */
    var performanceClickEndTime = function(){
        var parentsNode = $('#subperformancePage')
        $('.beginTime',parentsNode).removeClass("active");
        $('.endTime',parentsNode).addClass("active");
        STARTTIMEFLAG=false;
        ENDTTIMEFLAG=true ;
    }
    /*
     * 点击月份
     * */

    var performanceClickMonth = function(){
        if($('.monthList',PERFORMANCESELECTTIEM).css('display')=="block"){
            $('.monthList',PERFORMANCESELECTTIEM).hide();
        }else{
            $('.monthList',PERFORMANCESELECTTIEM).show();
        }

        $('.dayList',PERFORMANCESELECTTIEM).hide();
        $('.hourList',PERFORMANCESELECTTIEM).hide();
        $('.minuteList',PERFORMANCESELECTTIEM).hide();
    }
    /*
     * 点击日
     * */
    var performanceClickDate = function(){
        if($('.dayList',PERFORMANCESELECTTIEM).css('display')=="block"){


            $('.dayList',PERFORMANCESELECTTIEM).hide();

        }else{

            $('.dayList',PERFORMANCESELECTTIEM).show();
        }
        $('.monthList',PERFORMANCESELECTTIEM).hide();

        $('.hourList',PERFORMANCESELECTTIEM).hide();
        $('.minuteList',PERFORMANCESELECTTIEM).hide();
    }
    /*
     * 点击小时
     * */
    var performanceClickHour = function(){
        if($('.hourList',PERFORMANCESELECTTIEM).css('display')=="block"){


            $('.hourList',PERFORMANCESELECTTIEM).hide();

        }else{

            $('.hourList',PERFORMANCESELECTTIEM).show();
        }
        $('.monthList',PERFORMANCESELECTTIEM).hide();
        $('.dayList',PERFORMANCESELECTTIEM).hide();

        $('.minuteList',PERFORMANCESELECTTIEM).hide();
    }
    /*
     * 点击分钟
     * */
    var performanceClickMinute = function(){
        if($('.minuteList',PERFORMANCESELECTTIEM).css('display')=="block"){


            $('.minuteList',PERFORMANCESELECTTIEM).hide();

        }else{

            $('.minuteList',PERFORMANCESELECTTIEM).show();
        }
        $('.monthList',PERFORMANCESELECTTIEM).hide();
        $('.dayList',PERFORMANCESELECTTIEM).hide();
        $('.hourList',PERFORMANCESELECTTIEM).hide();

    }
    /*
     * 点击月的下拉列表
     * */
    var clickMonthSelect = function(obj){
        $('.monthList',PERFORMANCESELECTTIEM).hide();
        $('.performanceMonth',PERFORMANCESELECTTIEM).html(obj.html());
        if(STARTTIMEFLAG){
            PERFORMANCETIMESTART.month=obj.data('time');
        }else{
            PERFORMANCETIMEEND.month=obj.data('time');
        }
    }
    /*
     * 点击日的下拉列表
     * */
    var clickDateSelect = function(obj){
        $('.dayList',PERFORMANCESELECTTIEM).hide();
        $('.performanceDate',PERFORMANCESELECTTIEM).html(obj.html());
        if(STARTTIMEFLAG){
            PERFORMANCETIMESTART.date=obj.data('time');
        }else{
            PERFORMANCETIMEEND.date=obj.data('time');
        }
    }
    /*
     * 点击小时的下拉列表
     * */
    var clickHourSelect = function(obj){
        $('.hourList',PERFORMANCESELECTTIEM).hide();
        $('.performanceHour',PERFORMANCESELECTTIEM).html(obj.html());
        if(STARTTIMEFLAG){
            PERFORMANCETIMESTART.hour=obj.data('time');
        }else{
            PERFORMANCETIMEEND.hour=obj.data('time');
        }
    }
    /*
     * 点击分钟的下拉列表
     * */
    var clickMinuteSelect = function(obj){
        $('.minuteList',PERFORMANCESELECTTIEM).hide();
        $('.performanceMinute',PERFORMANCESELECTTIEM).html(obj.html());
        if(STARTTIMEFLAG){
            PERFORMANCETIMESTART.minute=obj.data('time');
        }else{
            PERFORMANCETIMEEND.minute=obj.data('time');
        }
    }

    return{
        /*点击主页面上的底部的我的按钮*/
        mineBtn:function(fun){
            mineBtn(fun);
        },
        /*查询按钮 交班*/inquireShiftExchange:function(fun){
            inquireShiftExchange(fun);
        },
        /*查询绩效*/inquirePerformance:function(fun){
            inquirePerformance();
        },
        /*绩效查询的时间确定按钮*/
        inquirePerformanceSelectTimeOk:function(fun){
            inquirePerformanceSelectTimeOk(fun);
        },
        /*主页面上的交班按钮*/
        shiftExchange:function(fun){

            shiftExchange(fun);
        },
        /*交班的现金支付*/shiftExchangePayWayOfCash:function(obj,fun){
            shiftExchangePayWayOfCash(obj,fun);
        },
        /*交班的POS支付*/shiftExchangePayWayOfPos:function(obj,fun){
            shiftExchangePayWayOfPos(obj,fun);
        },
        /*交班的网络支付*/shiftExchangePayWayOfNet:function(obj,fun){
            shiftExchangePayWayOfNet(obj,fun);
        },
        /*主页面上绩效按钮*/
        performance:function(fun){
            performance(fun);
        },
        /*主页面上的网络按钮*/
        netWork:function(fun){
            netWork(fun);
        },
        /*交班的确定按钮*/
        shiftExchangeOk:function(){
            shiftExchangeOk();
        },
        /*弹出框不交班*/
        shiftExchangePromptNot:function(){
            shiftExchangePromptNot();
        },
        /*弹出框交班*/
        shiftExchangePromptYes:function(fun){
            shiftExchangePromptYes(fun);
        },
        /*查询一天的交班记录*/
        seeOneHistoryOneDay:function(obj,fun){
            seeOneHistoryOneDay(obj,fun);
        },
        /*查询一条历史记录*/
        seeOneHistoryRecord:function(obj,fun){
            seeOneHistoryRecord(obj,fun);
        },
        /*现金支付*/cashPay:function(obj,fun){
            cashPay(obj,fun);
        },
        /*
         * pos支付
         * */
        posPay:function(obj,fun){
            posPay(obj,fun);
        },
        /*
         * 网络支付
         * */
        netWorkPay:function(obj,fun){
            netWorkPay(obj,fun)
        },
        /*绩效，处理服务*/
        dealWithSevice:function(obj,fun){
            dealWithSevice(obj,fun);
        },
        /*绩效，处理预定*/
        dealWithReserve:function(obj,fun){
            dealWithReserve(obj,fun);
        },
        /*绩效，处理外卖*/
        dealWithTakeOut:function(obj,fun){
            dealWithTakeOut(obj,fun);
        },
        /*绩效，处理结账订单*/
        dealWithBillOrder:function(obj,fun){
            dealWithBillOrder(obj,fun);
        },
        /*绩效，处理推广服务*/
        dealWithPromoteTheTask:function(obj,fun){
            dealWithPromoteTheTask(obj,fun);
        },
        /*绩效，处理好评率*/
        dealWithGoodProbability:function(obj,fun){
            dealWithGoodProbability(obj,fun);
        },
        /*绩效，点击开始时间*/
        performanceClickStartTime:function(){
            performanceClickStartTime();
        },
        /*绩效，点击结束时间*/
        performanceClickEndTime:function(){
            performanceClickEndTime();
        },
        /*点击月份*/
        performanceClickMonth:function(){
            performanceClickMonth();
        },
        /*点击日*/
        performanceClickDate:function(){
            performanceClickDate();
        },
        /*点击小时*/
        performanceClickHour:function(){
            performanceClickHour();
        },
        /*点击分钟*/
        performanceClickMinute:function(){
            performanceClickMinute();
        },
        /*点击月的下拉列表*/
        clickMonthSelect:function(obj){
            clickMonthSelect(obj);
        },
        /*点击月的下拉列表*/
        clickDateSelect:function(obj){
            clickDateSelect(obj);
        },
        /*点击月的下拉列表*/
        clickHourSelect:function(obj){
            clickHourSelect(obj);
        },
        /*点击月的下拉列表*/
        clickMinuteSelect:function(obj){
            clickMinuteSelect(obj);
        },


    }
}();